/* exported Component */
const { Clutter, Gio, GLib, GObject, St } = imports.gi;
-const Lang = imports.lang;
var Tpl = null;
var Tp = null;
}
}) : null;
+const ChatNotificationMessage = HAVE_TP ? GObject.registerClass(
+class ChatNotificationMessage extends GObject.Object {
+ _init(props = {}) {
+ super._init();
+ this.set(props);
+ }
+}) : null;
+
var ChatNotification = HAVE_TP ? GObject.registerClass({
Signals: {
- 'message-removed': { param_types: [Tp.Message.$gtype] },
- 'message-added': { param_types: [Tp.Message.$gtype] },
- 'timestamp-changed': { param_types: [Tp.Message.$gtype] },
+ 'message-removed': { param_types: [ChatNotificationMessage.$gtype] },
+ 'message-added': { param_types: [ChatNotificationMessage.$gtype] },
+ 'timestamp-changed': { param_types: [ChatNotificationMessage.$gtype] },
},
}, class ChatNotification extends MessageTray.Notification {
_init(source) {
styles: [],
timestamp: currentTime,
noTimestamp: false });
+ const { noTimestamp } = props;
+ delete props.noTimestamp;
// Reset the old message timeout
if (this._timestampTimeoutId)
GLib.source_remove(this._timestampTimeoutId);
this._timestampTimeoutId = 0;
- let message = { realMessage: props.group != 'meta',
- showTimestamp: false };
- Lang.copyProperties(props, message);
- delete message.noTimestamp;
+ let message = new ChatNotificationMessage({
+ realMessage: props.group !== 'meta',
+ showTimestamp: false,
+ ...props,
+ });
this.messages.unshift(message);
this.emit('message-added', message);
- if (!props.noTimestamp) {
+ if (!noTimestamp) {
let timestamp = props.timestamp;
if (timestamp < currentTime - SCROLLBACK_IMMEDIATE_TIME) {
this.appendTimestamp();